source("plotting.R")
library(tidyverse)



distance_rep = read_csv("../distance_main_effect_data.csv")

me = main_effect_rep(distance_rep)
#p = plot_main_effect_rep(me,"Effect of relative distance on voting\n(in percentage points)")

#save_plot("figures_for_paper/figure2.pdf", 
#          p, base_height = 14, base_asp = 1.5,device = cairo_pdf)


p = plot_main_effect_rep_default(me,"Effect of relative distance on voting\n(in percentage points)")

save_plot("figures_for_replication/figure2.pdf", 
          p, base_height = 14, base_asp = 1.5,device = cairo_pdf)


shock_rep = read_csv("../shock_main_effect_data.csv")
me = main_effect_rep(shock_rep)
#p = plot_main_effect_rep(me,"Effect of shock on voting\n(in percentage points)")
#save_plot("figures_for_paper/figure5.pdf", 
#          p, base_height = 14, base_asp = 1.5,device = cairo_pdf)

p = plot_main_effect_rep_default(me,"Effect of shock on voting\n(in percentage points)")
save_plot("figures_for_replication/figure5.pdf", 
          p, base_height = 14, base_asp = 1.5,device = cairo_pdf)

